package cn.bdqn.config;

import cn.bdqn.first.Pen;
import cn.bdqn.first.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

/**
 * @Description TODO
 * @Date 2020/2/13 11:06
 * @Created by 张三三
 */
@Configuration
@ImportResource("classpath:applicationContext-1.xml")
@ComponentScan("cn.bdqn.first")
public class SpringConfig {

    @Bean
    public Pen abc(){
        return new Pen("英雄",100);
    }

    @Bean
    public Student stu(){
        Student stu = new Student();
        stu.setName("张三");
        stu.setPen(abc());
        return stu;
    }
}
